package com.qire.manhua.activity;

import android.os.Bundle;

import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;
import com.qire.common.constant.Navigation;
import com.qire.common.inject.EventControllerInjector;
import com.qire.common.inject.ViewModelInjector;
import com.qire.common.support.base.BaseActivity;
import com.qire.common.utils.ThemeUtil;
import com.qire.manhua.R;
import com.qire.manhua.controller.ComicDownloadProgressController;
import com.qire.manhua.databinding.ActivityComicDownloadProgressBinding;
import com.qire.manhua.model.entity.ComicBookEntity;
import com.qire.manhua.model.viewModel.impl.ComicDownloadProgressViewModel;

import androidx.annotation.Nullable;

@RouteMapping(path = Navigation.Page.ComicDownloadProgressPage)
public class ComicDownloadProgressActivity extends BaseActivity<ActivityComicDownloadProgressBinding> {

    @Autowired
    ComicBookEntity comicBookEntity;

    @Autowired(injector = ViewModelInjector.class)
    ComicDownloadProgressViewModel viewModel;

    @Autowired(injector = EventControllerInjector.class)
    ComicDownloadProgressController controller;

    @Override
    public int layoutRid() {
        return R.layout.activity_comic_download_progress;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.changeStatusBarLightOrDark(this, true, true);

        viewModel.onAddition(this, controller);
        controller.onAddition(viewModel);

        viewModel.loadComicBookEntity(comicBookEntity);

    }
}
